package com.clear.iterator;


/**
 * 具体聚合
 */
public class IntArray implements Aggregate {

    private int[] values;

    public IntArray(int[] values) {
        this.values = values;
    }

    @Override
    public MyIterator iterator() {
        return new IntArrayIterator(this);
    }

    public int getValueAt(int index) {
        return values[index];
    }

    public int getLength() {
        return values.length;
    }
}
